package com.fangzhi.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fangzhi.mobel.BadType;
import com.fangzhi.service.BadTypeService;
import com.fangzhi.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bad")
public class BadTypeController {
    @Autowired
    private BadTypeService badTypeService;

    @RequestMapping("/badTypeList")
    public ResponseResult badTypeList() {
        List<BadType> list = badTypeService.list(Wrappers.<BadType>lambdaQuery().orderByAsc(BadType::getSort));
        return ResponseResult.OK(list);
    }
}
